const arrayWithDuplicates = [1, 2, 2, 3, 4, 4, 5];  
const uniqueArray = [...new Set(arrayWithDuplicates)];  
console.log(uniqueArray); // 输出 [1, 2, 3, 4, 5]